#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int N = 110;

char g[N][N];
int xa, ya, xb, yb;
int d[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
bool st[N][N];
int n;

bool dfs(int x, int y)
{
    if (g[x][y] == '#') return false;
    if (x == xb && y == yb) return true;
    
    st[x][y] = true;
    for (int i = 0; i < 4; i ++ )
    {
        int a = x + d[i][0], b = y + d[i][1];
        if (a < 0 || a >= n || b < 0 || b >= n) continue;
        if (st[a][b]) continue;
        if (dfs(a, b)) return true;
    }
    return false;
}


int main()
{
    int T;
    scanf("%d", &T);
    while (T -- )
    {
        scanf("%d", &n);
        for (int i = 0; i < n; i ++ ) scanf("%s", &g[i]);
        scanf("%d%d%d%d", &xa, &ya, &xb, &yb);
        memset(st, 0, sizeof st);
        if (dfs(xa, ya)) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}
